<template>
  <div class="button-com">
    <button
      :style="comData.style"
      :type="comData.comPorps.btnType"
      @click="btnClick"
    >
      {{ comData.comPorps.content }}
    </button>
  </div>
</template>

<script>
export default {
  props: ['comData', 'edit'],
  data() {
    return {
      //...
    }
  },
  methods: {
    btnClick(e) {
      if (this.edit) {
        e.preventDefault() //编辑模式下阻止跳转，点击时返回属性
      }
    },
  },
  computed: {
    pointEvent(edit) {
      return edit ? 'none' : 'initial'
    },
  },
}
</script>

<style lang="less" scoped>
.button-com {
  width: 75px;
  height: 40px;
  transition: all 0.2s;
  box-sizing: content-box;
  border: 1px solid transparent;
}

.button-com:hover {
  opacity: 0.8;
}
</style>
